﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ImageAcquisitionTAL
{
    public enum ColorMode { None = 0, Color = 1, GrayScale = 2, BW = 4 }
    
    public enum ScanSource { Flatbed, Feeder }
    
    public class ScannerInfo : ICloneable
    {
        public string DeviceID;
        public string DisplayName;
        public IAcquisitionTechnology Technology;
        public int[] SupportedResolutions;
        public bool SupportsColors;
        public bool SupportsGrayScale;
        public bool SupportsBW;
        public bool SupportsFeeder;
        public int CurrentResolution;
        public ColorMode CurrentColorMode;
        public ScanSource CurrentSource;
        public override string ToString()
        {
            return DisplayName;
        }

        #region ICloneable Members

        public object Clone()
        {
            ScannerInfo clone = new ScannerInfo();
            clone.CurrentColorMode = this.CurrentColorMode;
            clone.CurrentResolution = this.CurrentResolution;
            clone.CurrentSource = this.CurrentSource;
            clone.DeviceID = this.DeviceID;
            clone.DisplayName = this.DisplayName;
            clone.SupportedResolutions = new int[SupportedResolutions.Length];
            this.SupportedResolutions.CopyTo(clone.SupportedResolutions, 0);
            clone.SupportsBW = this.SupportsBW;
            clone.SupportsColors = this.SupportsColors;
            clone.SupportsFeeder = this.SupportsFeeder;
            clone.SupportsGrayScale = this.SupportsGrayScale;
            clone.Technology = this.Technology; // no copy. just reference
            return clone;
        }

        #endregion
    }
}
